package cn.edu.scau.cmi.xiaozhenlin.simpleFactoryMethod;

import cn.edu.scau.cmi.xiaozhenlin.insurance.CarDamage;
import cn.edu.scau.cmi.xiaozhenlin.insurance.Insurance;
import cn.edu.scau.cmi.xiaozhenlin.insurance.PhysicalInjury;
import cn.edu.scau.cmi.xiaozhenlin.insurance.Scratch;

public class InsuranceFactory {

	public static Insurance getInstance(String what) {
		switch (what) {
		case "身体受伤": {
			return new PhysicalInjury();
		}
		case "汽车损坏": {
			return new CarDamage();
		}
		case "汽车刮伤": {
			return new Scratch();
		}
		default:
			break;
		}
		return null;
	}
}
